package io.kiki.sba.registry.server.clientInterface.node.service;

import io.kiki.sba.registry.api.exchange.Callback;
import io.kiki.sba.registry.common.model.ClientOffPublishers;
import io.kiki.sba.registry.common.model.dataserver.DatumVersion;
import io.kiki.sba.registry.common.model.store.DataCenterToSubDatumMap;
import io.kiki.sba.registry.common.model.store.Publisher;

import java.util.Map;
import java.util.Set;


public interface DataStoreNodeService {

    /**
     * new publisher data transform to data server
     */
    void register(Publisher publisher);

    /**
     * remove publisher data from data server
     */
    void unregister(Publisher publisher);

    /**
     * session server support api to stop some client node,all register data on data server will be
     * removed data on session server will be remove too
     */
    void clientOff(ClientOffPublishers clientOffPublishers);

    void fetchDataVersion(String dataCenter, int slotId, Map<String, DatumVersion> interests, Callback<Map<String /*datainfoid*/, DatumVersion>> callback);

    /**
     * fetch one dataCenter publisher data from data server
     */
    DataCenterToSubDatumMap fetch(Set<String> dataCenters, String dataInfoId);
}
